package ControlLayer;
import ModelLayer.Group;
import DBLayer.DBGroup;
import java.util.ArrayList;

public class CtrGroup {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrGroup instance = null;
    DBGroup dbGroup = new DBGroup();

    public CtrGroup() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrGroup getInstance() {
        if (instance == null) {
            instance = new CtrGroup();
        }
        return instance;
    }

    public ArrayList<Group> getGroupList() {
        return dbGroup.getGroupList();
    }

    public Group getGroupByID(int id) {
        return dbGroup.getGroupByID(id);
    }

    public int addGroup(Group group) {
        return dbGroup.addGroup(group);
    }

    public int updateGroup(Group group, int id) {
        return dbGroup.updateGroup(group, id);
    }

    public void deleteGroup(int id) {
        dbGroup.deleteGroup(id);
    }
    // </editor-fold>
}
